package com.ruoyi.project.lely.bean.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import javax.validation.constraints.NotEmpty;
import org.hibernate.validator.constraints.Length;

/**
 * 文章信息
 *
 * @author luoyong
 */
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName(value = "`ly_article`", autoResultMap = true)
public class LyArticle {


    @ApiModelProperty("ID")
    @TableId("id")
    private Long id;


    @Length(max = 20, message = "信息类型长度不能超过20位")
    @NotEmpty
    @ApiModelProperty("信息类型")
    @TableField(value = "`type`")
    private String type;


    @Length(max = 255, message = "信息标题长度不能超过255位")
    @ApiModelProperty("信息标题")
    @TableField(value = "`title`")
    private String title;


    @Length(max = 65535, message = "信息内容,富文本格式长度不能超过65535位")
    @ApiModelProperty("信息内容,富文本格式")
    @TableField(value = "`content`")
    private String content;


    @ApiModelProperty("创建时间")
    @TableField(value = "`create_time`", fill = FieldFill.INSERT)
    private LocalDateTime createTime;


    @ApiModelProperty("更新时间")
    @TableField(value = "`update_time`", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;


    @ApiModelProperty("逻辑删除")
    @TableField(value = "`deleted`", fill = FieldFill.INSERT)
    private Integer deleted;

}
